package net.vkits.anjiamiao.application;

import net.vkits.anjiamiao.domain.service.VerifyCodeService;
import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;

/**
 * Created by ethan-liu on 16/6/5.
 */
@Service
public class VerifyCodeApplicationService {

    private static final Logger logger = LoggerFactory.getLogger(VerifyCodeApplicationService.class);

    @Resource
    private VerifyCodeService verifyCodeService;

    @Transactional
    public void sendSmsCode(String cellPhoneNum){
        String verifyCode = RandomStringUtils.randomNumeric(6);
        verifyCodeService.create(cellPhoneNum, verifyCode);
    }
}
